 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.viettel.core.dao.cms.PublicArticleDAO;
import com.viettel.core.entities.cms.PublicArticle;
import com.viettel.core.entities.vo.PublicArticleSearchFilter;
import com.viettel.core.entities.vo.PublicArticleSearchVO;
import com.viettel.core.exceptions.BusinessException;
import com.viettel.core.exceptions.DataAccessException;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TuanTM20
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
 public class PublicArticleMgrImpl implements PublicArticleMgr{ 
	@Autowired 
	PublicArticleDAO publicArticleDAO; 
 
 	/**@author TuanTM20
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public PublicArticle getPublicArticleById(Integer id) throws BusinessException { 
		try { 
			return  publicArticleDAO.getPublicArticleById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TuanTM20
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public PublicArticle createPublicArticle(PublicArticle publicArticle) throws BusinessException { 
		try { 
			return publicArticleDAO.createPublicArticle(publicArticle); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TuanTM20
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updatePublicArticle(PublicArticle publicArticle) throws BusinessException { 
		try { 
			publicArticleDAO.updatePublicArticle(publicArticle); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TuanTM20
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deletePublicArticle(PublicArticle publicArticle) throws BusinessException { 
		try { 
			publicArticleDAO.deletePublicArticle(publicArticle); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<PublicArticleSearchVO> getListPublicArticleByFilter(
			PublicArticleSearchFilter filter) throws BusinessException {
		try { 
			return publicArticleDAO.getListPublicArticleByFilter(filter); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	
} 
